home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-03-08 | 4.0 KB | 136 lines | [TEXT/dIsR] |
-
- -- UTexas CS Dept. "im4u" login script. vers. 3/8/94
-
- -- DialScript script for use with U Texas CS Dept modem pool attached to
- -- host im4u.
-
- -- You need to set the variable for your username, etc. in state init and
- -- fix up state FinishUp (optional).
-
- script im4u
-
- state init
-
- display "Beginning UT CS im4u login script.\r";
- set online on;
-
- -- Here are things you may need to customize
-
- setvar USERNAME "newton\r";
- input PASSWORD noecho; -- You could use a setvar here.
-
- setvar PHONE "ATDT4718454\r";
-
- setvar ModemInitString "AT\r";
- setvar Modem_Escape_String "+++";
-
- set speed 2400; -- If you use a 1200 baud modem, change this and take
- -- a look at state GotIt below.
-
- send ModemInitString;
- next "ModemReady";
-
- end; -- init
-
-
- -- This state makes sure we have the (Hayes-type) modem's attention.
-
- state ModemReady
- repeat 2
- send "AT\r";
- select
- "OK": next "Dial";
- timeout 3: display "ModemReady timeout!\r";
- end;
- end; -- repeat
-
- next "HangUp"; -- failed again, maybe hangup
- end; -- ModemReady
-
-
- -- The state hangs up a Hayes modem by sending +++, waiting for OK,
- -- and then sending ATH.
-
- state HangUp
- repeat 2
- delay 1; send Modem_Escape_String;
- select
- "OK" : send "ATH\r"; next "ModemReady";
- timeout 3 : display "HangUp timeout!\r";
- end;
- end;
-
- send "\r"; send "ATH\r";
- next "ModemReady";
- end; -- HangUp
-
-
- -- This state dials the phone number and awaits the CONNECT message.
- -- The select causes a redial if the line is busy, the modem responds
- -- with NO CARRIER, or the modem does not respond with 25 seconds.
-
- state Dial
- send PHONE; -- The system's phone number
- select
- "CONNECT" : next "GotIt";
- "BUSY" : next "Dial";
- "NO CARRIER" : next "Dial";
- timeout 25 : display "Dial timeout!\r"; next ModemReady;
- end;
- end; -- Dial
-
-
- -- This state enters the username and the password in reponse to
- -- the appropriate prompts.
-
- state GotIt
-
- -- im4u responds at 1200 even when you login at 2400. A break
- -- cycles it among 1200 and 2400. If you use 2400, you defintely
- -- need to send a break. Hence the "send break" *before* the select.
- -- If you use 1200, you can move the send break after the "end;" of
- -- the select statement to avoid timeouts. You do not need to.
-
- repeat 6
- send break; -- Best location for 2400 bps modems.
- select
- "login:" : send USERNAME; next "DoPass";
- timeout 3 : display "login timeout!\r";
- end;
- -- send break; -- is better here for 1200 bps modems.
- end;
-
- end; -- GotIt
-
-
- state DoPass -- Send the password
- select
- "Password:" : send PASSWORD; send "\r"; -- Your password and return
- timeout 45 : display "password timeout!\r"; next "HangUp";
- end;
-
- next "FinishUp";
- end; -- DoPass
-
-
- -- This state is used to answer the terminal type prompt. The nature
- -- of this prompt depends on your .login file on UNIX. You need to
- -- to customize this state for your circumstances. I enter return
- -- to confirm that I will use a vt100 emulator and then switch to
- -- the emulator I use (MacLayers) by means of the transfer. "RunLayers"
- -- is my settings file for MacLayers. This script has to be in the
- -- same folder as MacLayers and RunLayers in order for the transfer to
- -- succeed. The transfer quits DialScript and runs MacLayers with
- -- settings file RunLayers (as though I had double clicked on RunLayers
- -- from the finder).
-
- state FinishUp -- You need to customize this. What's here is weak.
-
- wait "(vt100)"; -- Terminal type prompt
- send "\r"; -- Yes to vt100
- -- transfer "MacLayers" "RunLayers"; -- Run real terminal emulator
-
- end; -- FinishUp
-
- end; -- cs
-